import gl
import sys
print(sys.version)
print(gl.version())
gl.resetdefaults()

# Open background image (Adapt as needed)
gl.loadimage('C:/Users/mlw/Desktop/MRIcroGL/Resources/standard/mni152.nii.gz')

# Turn off smoothing
gl.overlayloadsmooth(0)

# Glass brain settings
gl.shadername('Glass')
gl.shaderadjust('boundThresh', 0.38)
gl.shaderadjust('boundBrightness',0.8)
gl.shaderadjust('shaderquality1to10', 6)

# Load overlays (Adapt as needed)
gl.overlayload('C:/Users/mlw/Dropbox (Personal)/Projects_Berkeley/CBMA_IO/ReproVersion_IO/Monetary_loss_P005_1000_ALE.nii.gz')
gl.overlayload('C:/Users/mlw/Dropbox (Personal)/Projects_Berkeley/CBMA_IO/ReproVersion_IO/Physical_pain_P005_1000_ALE.nii.gz')

# Set overlay display parameters; 1 indicates 1st overlay
gl.colorname(1,"Grayscale")
gl.colorname(2,"Grayscale")

# for greyscale
gl.minmax(1, 0.01, 0.01)
gl.minmax(2,  0.001, 0.25)


# Overlay blending
gl.overlayadditiveblending(0)

# Set the color bar options 
gl.colorbarposition(0)

# Set the background color
gl.backcolor(255,255,255)

# Change brain layer opacity 
gl.opacity(0,75)
gl.opacity(1,100)
gl.opacity(2,100)

# Shift the camera angle
gl.azimuthelevation(115,10)

# Save the image 
#gl.savebmp('Fig1A.png')
